package com.ztesoft.book.common.utils;

import java.util.HashMap;

/**
 * @Description Antd Pro 表格标准数据
 * @Author YangFan
 * @Date 2021-06-15 10:05
 */
public class ResultAntdTable extends HashMap<String, Object> {


    /**
     * 方法功能描述:
     * < Antd Pro 表格标准数据 >
     *
     * @return null                            【返回值 注释说明】
     * @author YangFan
     * @date 2021-06-18 18:26
     */
    public ResultAntdTable() {
        put("success", true);
    }


    public static ResultAntdTable success(Object obj, Object total) {
        ResultAntdTable r = new ResultAntdTable();
        r.put("data", obj);
        r.put("total", total);
        return r;
    }


    public static ResultAntdTable error() {
        ResultAntdTable r = new ResultAntdTable();
        r.put("success", false);
        return r;
    }


    @Override
    public ResultAntdTable put(String key, Object value) {
        super.put(key, value);
        return this;
    }
}
